import { defineStore } from "pinia";

interface IDataInfo {
  name: string;
}

export const useLongStore = defineStore("longdata", {
  state: () => {
    return {
      dataInfo: {} as IDataInfo,
    };
  },
  persist: [
    {
      paths: ["dataInfo"],
      storage: localStorage,
    },
  ],
  actions: {
    updateVal(val: IDataInfo) {
      console.log(val);
      this.dataInfo = val;
    },
  },
});
export default useLongStore;
